#!/usr/bin/perl -w

# skipline
# File ID: dcd11fb0-5d43-11df-8525-90e6ba3022ac
# Only prints every n'th line from stdin

defined($ARGV[0]) || die("\nSyntax: $0 number_of_lines_to_skip [file [...]]\n\n");

my $Skip = $ARGV[0];
shift;

($Skip =~ /[^0-9]/) && die("$Skip: Invalid character in number");
$Skip || die("Number has to be greater than zero");

my $Count = 0;

while(<>) {
	($Count++ % $Skip) || print;
}
